package com.m4f.fse.model;

import java.io.Serializable;

public class Result<T extends Serializable> implements Comparable<Result<?>> {
	
	private T result;
	private int relevance = 0;
	
	public Result(T r) {
		this.result = r;
	}
	
	public T get() {
		return this.result;
	}
	
	public void setRelevance(int r) {
		this.relevance = r;
	}
	
	public int getRelevance() {
		return this.relevance;
	}
	
	@Override
	public int compareTo(Result<?> o) {
		if(this.relevance > o.getRelevance()) {
			return -1;
		}
		if(this.relevance < o.getRelevance()) {
			return 1;
		}
		return -1;
	}
	
}